const fs = require('fs');
const path = require('path');



let code = `

class C {

    @p({
        onchange: function () {}
    })
    m = 123;

    @p
    d = '';
}

const T = class {

    @p(10)
    e = 1;
}

`;



try
{
    let result = require("@babel/core").transformSync(code, {
        plugins: [
            require('../../babel/plugin-property'),
            [require("@babel/plugin-syntax-decorators"), {
                decoratorsBeforeExport: true,
                // legacy: true
            }],
            [require('@babel/plugin-proposal-class-properties'), {
                loose: true  
            }]
        ]
    });

    fs.writeFileSync(path.join(__dirname, 'demo.js'), result.code, 'utf8');
}
catch (e)
{
    debugger
}



